package com.lt73.ext.controller;

import com.lt73.ext.entity.IdentityCard;
import com.lt73.ext.repository.IdentityCardRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * 关联查询例子
 * @Author: hanxiao
 * @Date: 2022/4/15 11:43
 */
@RestController
@RequestMapping("/identityCard")
public class IdentityCardController {

    @Autowired
    private IdentityCardRepository identityCardRepository;

    @PostMapping("/insert")
    public Boolean insert() {

        //注册用户
        IdentityCard identityCard = new IdentityCard();
        identityCard.setUserId("1515866850241662977");
        identityCard.setIdentityNumber(LocalDateTime.now().toString());

        return identityCardRepository.save(identityCard);
    }

}
